/**
 * Created by zzw on 2016/5/19.
 * 个人资料详情
 */
$(function(){
    function getUrlPage(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]);
        return null;
    }
    var agenttype = getUrlPage('agenttype');
    var agentId = getUrlPage('agentId');
    var param = JSON.stringify({"type":agenttype,"agentId":agentId,"token": localStorage.token});
    $.fn.serviceInvoke(serviceAddress.Address, 'agent_app_AgentTree','queryAgentById.action', param, function (result) {
        $(".realName").html(result.entity.realName);
        if(result.entity.sex==0){
            $(".sex").html("男");
        }else{
            $(".sex").html("女");
        }
        $(".birth").html(result.entity.birthDay);
        $(".telNo").html(result.entity.phone);
        $(".QQ").html(result.entity.qq);
        $(".address").html(result.entity.addres);
        $(".e-mail").html(result.entity.mail);
        $(".tell").html(result.entity.mobile);
        $(".salary").html("￥"+result.entity.totalMoney);
    })
});